// 防抖
export default function debounce(fn, timeout = 500) {
  let timer;
  return function() {
    if (timer) {
      clearTimeout(timer);
    }
    timer = setTimeout(() => {
      fn.apply(this, arguments);
    }, timeout);
  };
}
